import React, { Component } from 'react'

export default class TotalCheck extends Component {
  render() {
    return (
      <div>
        <input type="checkbox"
          checked={this.props.totalCheck}
          onChange={() => this.handletotalCheck()}
        />
      </div>
    )
  }

  handletotalCheck = () => {
    let flag = this.props.totalCheck;
    flag = !flag;
    const { totalEvent } = this.props;
    totalEvent && totalEvent(flag)
  }
}
